package com.atguigu.spzx.manager.controller;


import com.atguigu.spzx.manager.service.ProductUnitService;
import com.atguigu.spzx.model.entity.base.ProductUnit;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Henry
 * @version 1.0
 * @program: spzx-parent
 * @create: 2025/6/12 下午4:45
 */

@RestController
@RequestMapping("/admin/product/productUnit")
public class ProductUnitController {


    @Resource
    private ProductUnitService productUnitService;

    // 加载商品单元数据
    @GetMapping("findAll")
    public Result<List<ProductUnit>> findAll() {
        List<ProductUnit> productUnitList = productUnitService.findAll();
        return Result.build(productUnitList , ResultCodeEnum.SUCCESS) ;
    }
}
